import {Component, OnInit} from '@angular/core';
import {NavController} from 'ionic-angular';
import {PersonPage} from '../person/person';
import {services} from "../../providers/service";

@Component({
    selector: 'page-modifyPsw',
    templateUrl: 'modifyPsw.html'
})
export class ModifyPswPage implements OnInit {
    phone;
    hasClick = false;
    num = 120;

    constructor(public navCtrl: NavController,
                public service: services) {

    }

    goback() {
        this.navCtrl.pop(PersonPage);
    }

    sendMunber() {
        this.hasClick = true;
        let timer = setInterval(() => {
            if (this.num == 110) {
                clearInterval(timer);
                this.hasClick = false;
                this.num = 120;
                return;
            }
            this.num--;
        }, 1000)

    }

    ngOnInit() {
        this.phone = this.service.phone;
        console.log(this.phone);
    }

}
